package com.liang.text9;

public class Text9Inner {
    public static void main(String[] args) {
        useCalculator(new Calculator() {
            @Override
            public int clac(int a, int b) {

                return a+b;
            }
        });

        useCalculator((int a,int b)->{return a+b;});

    }

    public static void useCalculator(Calculator calculator) {
      int result = calculator.clac(10, 20);
        System.out.println(result);
    }
}

@FunctionalInterface
interface Calculator{
    public abstract int clac(int a,int b);


}